package com.hopu.dy.mapper;

import com.hopu.dy.pojo.GongNeng;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface GongNengMapper {
    // 根据视频ID获取功能数据
    @Select("SELECT * FROM t_gongneng WHERE shipin_id = #{shipinId}")
    GongNeng selectByShipinId(long shipinId);

    // 更新点赞数量
    @Update("UPDATE t_gongneng SET love_number = #{loveNumber} WHERE id = #{id}")
    int updateLoveNumber(GongNeng gongNeng);

    // 更新评论数量
    @Update("UPDATE t_gongneng SET pinglun_number = #{pinglunNumber} WHERE id = #{id}")
    int updatePinglunNumber(GongNeng gongNeng);

    // 更新转发数量
    @Update("UPDATE t_gongneng SET zhuanfa_number = #{zhuanfaNumber} WHERE id = #{id}")
    int updateZhuanfaNumber(GongNeng gongNeng);

    // 更新收藏数量
    @Update("UPDATE t_gongneng SET shoucang_number = #{shoucangNumber} WHERE id = #{id}")
    int updateShoucangNumber(GongNeng gongNeng);
}